public class Test {

    public static void animaleat(Animal animal) {
        animal.eat();
    }

    public static void main(String[] args) {
        Dog dog = new Dog("旺财", 18);
        Cat cat = new Cat("小喵", 29);
        animaleat(dog);
        animaleat(cat);

    }

}
